<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <title>存储过程 | Is2</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="存储过程">
<meta property="og:type" content="article">
<meta property="og:title" content="存储过程">
<meta property="og:url" content="/2015/03/26/Sql-Stored-procedure/index.html">
<meta property="og:site_name" content="Is2">
<meta property="og:description" content="存储过程">
<meta property="og:updated_time" content="2016-10-08T12:46:00.550Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="存储过程">
<meta name="twitter:description" content="存储过程">
  
    <link rel="alternate" href="/atom.xml" title="Is2" type="application/atom+xml">
  
  
    <link rel="icon" href="img/logo.ico">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">

  

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" integrity="sha384-XdYbMnZ/QjLh6iI4ogqCTaIjrFk87ip+ekIjefZch0Y+PvJ8CDYtEs1ipDmPorQ+" crossorigin="anonymous">

  <link rel="stylesheet" href="/css/styles.css" type="text/css">
  

  
  <!--百度统计代码-->
  <script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?37b51d72e2b91d854971620de6fef9bc";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
<!--百度自动推送代码-->
<script>
(function(){
    var bp = document.createElement('script');
    bp.src = '//push.zhanzhang.baidu.com/push.js';
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>
<script async src="https://dn-lbstatics.qbox.me/busuanzi/2.3/busuanzi.pure.mini.js">
</script>
</head>

<body>
  <nav class="navbar navbar-inverse">
  <div class="container">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#main-menu-navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="main-menu-navbar">
      <ul class="nav navbar-nav">
        
          <li><a class=""
                 href="/index.html">首页</a></li>
        
          <li><a class=""
                 href="/categories/文集/">文集</a></li>
        
          <li><a class=""
                 href="/archives/">归档</a></li>
        
          <li><a class=""
                 href="/resource/">资源</a></li>
        
          <li><a class=""
                 href="/about/">关于</a></li>
        
        <li> <a href="/atom.xml">RSS</a> </li> 
      </ul>

      <!--
      <ul class="nav navbar-nav navbar-right">
        
          <li><a href="/atom.xml" title="RSS Feed"><i class="fa fa-rss"></i></a></li>
        
      </ul>
      -->
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>

  <div class="container">
    <div class="blog-header">
  <h1 class="blog-title">Is2</h1>
  
    <p class="lead blog-description">我只想做的更好</p>
  
</div>

    <div class="row">
        <div class="col-sm-8 blog-main">
          <article id="post-Sql-Stored-procedure" class="article article-type-post" itemscope itemprop="blogPost">

  <header class="article-header">
    
  
    <h1 class="article-title" itemprop="name">
      存储过程
    </h1>
  


  </header>

  <div class="article-meta">
    <div class="article-datetime">
  <a href="/2015/03/26/Sql-Stored-procedure/" class="article-date"><time datetime="2015-03-26T03:25:35.000Z" itemprop="datePublished">2015-03-26</time></a>
</div>

    
    
  <div class="article-category">
    <a class="article-category-link" href="/categories/SQL/">SQL</a>
  </div>

  </div>
  <div class="article-inner">

    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="什么是存储过程">什么是存储过程</h2><p>　　调用<a href="http://baike.baidu.com/link?url=c2abUFqhD2LK7x4of_AqDRsR9zA_O8N7DSr-IK1oY_7C8_0OxNX-3mVmBfbPpYo5yhMm8nUGydsNQV0NJ73EL_" target="_blank" rel="external">百度百科</a>的解释:存储过程（Stored Procedure）是在大型数据库系统中，一组为了完成特定功能的SQL 语句集，存储在数据库中，经过第一次编译后再次调用不需要再次编译，用户通过指定存储过程的名字并给出参数（如果该存储过程带有参数）来执行它。存储过程是数据库中的一个重要对象，任何一个设计良好的数据库应用程序都应该用到存储过程。<br>　　简单来说，存储过程就像是c#中的<strong>方法</strong>，该方法实现某一特定的功能，在需要的地方直接调用就行了。而且该方法还是单例的。<br>　　存储过程不仅仅是一组SQL语句的组合，存储过程和一般的SQL语句还是有区别的。<br>　　<a id="more"></a><br>　　当我们使用SQL Server数据库帮助我们建立网站或应用软件时，Transaction-SQL是一种主要的编程语言，使用SQL语句(Transaction-SQL)编程有两种方法：<br>　　① 在本地存储SQL语句编写的代码，通过程序连接数据库，对SQL Server进行操作。<br>　　② 把部分复杂或重用的SQL语句封装成存储过程，存储在SQL Server数据库中，然后通过程序去调用存储过程即可。而且还可以在存储过程中调用另一个存储过程。</p>
<h3 id="存储过程的优点">存储过程的优点</h3><p>　　1.存储过程只在创建时进行编译，以后每次执行都不需要重新编译，而一般SQL语句每执行一次就编译一次，所以存储过程可以提高数据库的执行速度。<br>　　2.对数据库进行复杂操作时(比如对多张表进行SELECT、INSERT、UPDATE、DELETE)，可将此复杂操作封装成存储过程，然后结合数据库中的事物处理一起使用。<br>　　3.存储过程可以复用，从而减少开发人员的工作量。<br>　　4.安全性高，可以设定操作此存储过程的用户权限。<br>　　5.使用时只需要传输调用语句，而非多条SQL语句，减少网络流量，降低网络负载。</p>
<h3 id="存储过程的种类">存储过程的种类</h3><p>　　1.系统存储过程：以<code>SP_</code>开头，用来进行系统的各项设定、取得信息、相关管理，比如<code>SP_help</code>就是取得指定对象的相关信息。<br>　　2.扩展存储过程：以<code>XP_</code>开头，用来调用操作系统提供的功能，<code>exec master ..XP_cmdshell &#39;ping 120.110.119:12306&#39;</code><br>　　3.用户自定的存储过程，也就是这篇博客所说的存储过程。</p>
<h2 id="创建存储过程">创建存储过程</h2><p>创建语法：<br>　　create proc usp_name<br>　　形参列表(形参名称以@符号开头，参数类型在后)<br>　　as<br>　　  方法体<br>　　go</p>
<p>调用语法：<br>　　exec 存储过程名称 实参,实参,实参…</p>
<p>　　<text style="color:red">在调用的时候要三个对应：类型对应、数量对应、顺序对应。<text></text></text></p>
<h3 id="代码示例：">代码示例：</h3><p><strong>获取所有员工信息</strong><br><figure class="highlight oxygene"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">go</span><br><span class="line"><span class="keyword">if</span> exists(<span class="keyword">select</span> * <span class="keyword">from</span> sysobjects <span class="keyword">where</span> name=<span class="string">'usp_getAllStaffInfo'</span>)</span><br><span class="line">    drop proc usp_getAllStaffInfo</span><br><span class="line">go</span><br><span class="line"></span><br><span class="line"><span class="keyword">create</span> <span class="function"><span class="keyword">procedure</span> <span class="title">usp_getAllStuInfo</span></span><br><span class="line"><span class="title">as</span></span><br><span class="line">    <span class="title">select</span> * <span class="title">from</span> <span class="title">Staff</span></span><br><span class="line"><span class="title">go</span></span><br><span class="line"></span><br><span class="line">--调用存储过程</span><br><span class="line"><span class="title">execute</span> <span class="title">usp_getAllStaffInfo</span></span></span><br></pre></td></tr></table></figure></p>
<p><strong>查询指定性别的员工信息</strong><br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">go</span><br><span class="line">if exists(<span class="operator">select * <span class="keyword">from</span> sysobjects <span class="keyword">where</span> <span class="keyword">name</span>=<span class="string">'usp_GetStaffInfoBySex'</span>)</span><br><span class="line">    <span class="keyword">drop</span> proc usp_GetStaffInfoBySex</span><br><span class="line"><span class="keyword">go</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">create</span> PROC usp_GetStaffInfoBySex</span><br><span class="line">@sex <span class="keyword">nchar</span>(<span class="number">1</span>)   </span><br><span class="line"><span class="keyword">as</span></span><br><span class="line">    select * <span class="keyword">from</span> Staff <span class="keyword">where</span> Sex=@sex</span><br><span class="line"><span class="keyword">go</span></span><br><span class="line"></span><br><span class="line"><span class="comment">--调用存储过程</span></span><br><span class="line">EXEC usp_GetStaffInfoBySex <span class="string">'男'</span></span></span><br></pre></td></tr></table></figure></p>
<p><strong>获取指定部门和性别的员工信息</strong><br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">go</span><br><span class="line">if exists(<span class="operator">select * <span class="keyword">from</span> sysobjects <span class="keyword">where</span> <span class="keyword">name</span>=<span class="string">'usp_GetStaffInfoBySexForClass'</span>)</span><br><span class="line">    <span class="keyword">drop</span> PROC usp_GetStaffInfoBySexForClass</span><br><span class="line"><span class="keyword">go</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">create</span> PROC usp_GetStaffInfoBySexForClass</span><br><span class="line">@className <span class="keyword">nvarchar</span>(<span class="number">20</span>)</span><br><span class="line">@sex ncahr(<span class="number">1</span>)=<span class="string">'男'</span>   <span class="comment">--有默认值的形参</span></span><br><span class="line"><span class="keyword">as</span></span><br><span class="line">    <span class="keyword">declare</span> @classId <span class="built_in">int</span>   <span class="comment">--声明一个存储部门ID的变量</span></span><br><span class="line">    <span class="keyword">set</span> @classId=(select classId <span class="keyword">from</span> Company <span class="keyword">where</span> className=@className)</span><br><span class="line">    select * <span class="keyword">from</span> Staff <span class="keyword">where</span> Sex=@sex <span class="keyword">and</span> classId=@classId</span><br><span class="line"><span class="keyword">go</span></span><br><span class="line"></span><br><span class="line"><span class="comment">--调用存储过程</span></span><br><span class="line">EXEC usp_GetStaffInfoBySexForClass @classId=<span class="string">'.NET部'</span>,@sex=<span class="string">'男'</span></span><br><span class="line">EXEC usp_GetStaffInfoBySexForClass <span class="string">'.NET部'</span>,<span class="string">'男'</span></span><br><span class="line">EXEC usp_GetStaffInfoBySexForClass <span class="keyword">default</span>,<span class="string">'.NET部'</span>    <span class="comment">--不需要改变默认值就是用default关键字</span></span></span><br></pre></td></tr></table></figure></p>
<p><strong>返回指定性别员工人数和总人数</strong><br>　　<code>output</code>参数相当于c#中的<code>out</code>参数，用于将参数返回，所以在调用的时候需要声明变量去接收。注意在接收的时候，接收的变量后也要有<code>output</code>参数。<br><figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line">go</span><br><span class="line">if exists(<span class="operator">select * <span class="keyword">from</span> sysobjects <span class="keyword">where</span> <span class="keyword">name</span>=<span class="string">'usp_GetStaffManAndStaffCount'</span>)</span><br><span class="line"><span class="keyword">create</span> proc usp_GetStaffManAndStaffCount</span><br><span class="line">    @sex <span class="keyword">nchar</span>(<span class="number">1</span>),</span><br><span class="line">    @SexCount <span class="built_in">int</span> <span class="keyword">output</span>,</span><br><span class="line">    @<span class="keyword">count</span> <span class="built_in">int</span> <span class="keyword">output</span></span><br><span class="line"><span class="keyword">as</span></span><br><span class="line">    <span class="keyword">set</span> @SexCount=(select <span class="keyword">count</span>(*) <span class="keyword">from</span> Staff <span class="keyword">where</span> Sex=@sex)</span><br><span class="line">    <span class="keyword">set</span> @<span class="keyword">count</span>=(select <span class="keyword">count</span>(*) <span class="keyword">from</span> Staff)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">--调用存储过程</span></span><br><span class="line"><span class="keyword">declare</span> @manCount <span class="built_in">int</span>,@sumCount <span class="built_in">int</span></span><br><span class="line">exec usp_GetStaffManAndStaffCount <span class="string">'男'</span>,@manCount <span class="keyword">output</span>,@sumCount <span class="keyword">output</span></span></span><br></pre></td></tr></table></figure></p>
<p>🎫 <strong>一个分页存储过程</strong><br><figure class="highlight nimrod"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> exists(select * <span class="keyword">from</span> sysobjects where name='usp_pageing')</span><br><span class="line">    drop <span class="keyword">proc</span> usp_pageing</span><br><span class="line"></span><br><span class="line">create <span class="keyword">proc</span> usp_pageing</span><br><span class="line">    @totalPage <span class="type">int</span> output,   --总页数</span><br><span class="line">    @pageIndex <span class="type">int</span>=<span class="number">1</span>,   --当前的页码数，默认从<span class="number">1</span>开始</span><br><span class="line">    @pageCount <span class="type">int</span>=<span class="number">10</span>   --每页显示的条目数</span><br><span class="line"><span class="keyword">as</span></span><br><span class="line">    select * <span class="keyword">from</span> (select <span class="type">ROW_NUMBER</span>() over(order by newsCreateDate) id, * <span class="keyword">from</span> <span class="type">News</span>) item where item.<span class="type">Id</span>&gt;(@pageIndex-<span class="number">1</span>)*@pageCount <span class="keyword">and</span> item.<span class="type">Id</span>&lt;=(@pageIndex*@pageCount)</span><br><span class="line">    <span class="type">set</span> @totalPage=ceiling((select count(*) <span class="keyword">from</span> <span class="type">News</span>)*<span class="number">1</span>.<span class="number">0</span>/@pageCount)   --ceiling函数为向上四舍五入，如：ceiling(<span class="number">1</span>.<span class="number">45</span>,<span class="number">0</span>) = <span class="number">2</span>;ceiling(<span class="number">1</span>.<span class="number">55</span>,<span class="number">0</span>)=<span class="number">2</span></span><br></pre></td></tr></table></figure></p>

      
    </div>

    
      

    
    <br/><br/>
<!--baidu share-->

<div class="bdsharebuttonbox"><a class="bds_more" href="#" data-cmd="more">分享到：</a><a title="分享到新浪微博" class="bds_tsina" href="#" data-cmd="tsina">新浪微博</a><a title="分享到微信" class="bds_weixin" href="#" data-cmd="weixin">微信</a><a title="分享到QQ空间" class="bds_qzone" href="#" data-cmd="qzone">QQ空间</a><a title="分享到QQ好友" class="bds_sqq" href="#" data-cmd="sqq">QQ好友</a></div>
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{"bdSize":16}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
  
<!--baidu share-->
    <footer class="article-footer">
      <a data-url="/2015/03/26/Sql-Stored-procedure/" data-id="ciqvzmhp3002ecsvlvzrkhu22" class="article-share-link">
        <i class="fa fa-share"></i> Share
      </a>
      
      
  <ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/SQL-Server/">SQL Server</a></li></ul>


    </footer>
  </div>
  
    
<ul id="article-nav" class="nav nav-pills nav-justified">
  
  <li role="presentation">
    <a href="/2015/03/25/Added-the-database-search-statement-summary/" id="article-nav-older" class="article-nav-link-wrap">
      <i class="fa fa-chevron-left pull-left"></i>
      <span class="article-nav-link-title">数据库基本增删改查语句总结</span>
    </a>
  </li>
  
  
  <li role="presentation">
    <a href="/2015/04/01/SQL-Server-Transaction/" id="article-nav-newer" class="article-nav-link-wrap">
      <span class="article-nav-link-title">SQL Server事务</span>
      <i class="fa fa-chevron-right pull-right"></i>
    </a>
  </li>
  
</ul>


  
</article>


<section id="comments">
  <div id="disqus_thread">
    <!-- 多说评论框 start -->
	<div class="ds-thread" data-thread-key="2015/03/26/Sql-Stored-procedure/" data-title="存储过程" data-url="/2015/03/26/Sql-Stored-procedure/"></div>
<!-- 多说评论框 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"hais2"};
	(function() {
		var ds = document.createElement('script');
		ds.type = 'text/javascript';ds.async = true;
		ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
		ds.charset = 'UTF-8';
		(document.getElementsByTagName('head')[0] 
		 || document.getElementsByTagName('body')[0]).appendChild(ds);
	})();
	</script>
<!-- 多说公共JS代码 end -->
  </div>
</section>


        </div>
        <div class="col-sm-3 col-sm-offset-1 blog-sidebar">
          
  <div class="sidebar-module sidebar-module-inset">
<a style="text-decoration:none" title="有本事点我一下试试.." href='javascript:(function() {
	function c() {
		var e = document.createElement("link");
		e.setAttribute("type", "text/css");
		e.setAttribute("rel", "stylesheet");
		e.setAttribute("href", f);
		e.setAttribute("class", l);
		document.body.appendChild(e)
	}
 
	function h() {
		var e = document.getElementsByClassName(l);
		for (var t = 0; t < e.length; t++) {
			document.body.removeChild(e[t])
		}
	}
 
	function p() {
		var e = document.createElement("div");
		e.setAttribute("class", a);
		document.body.appendChild(e);
		setTimeout(function() {
			document.body.removeChild(e)
		}, 100)
	}
 
	function d(e) {
		return {
			height : e.offsetHeight,
			width : e.offsetWidth
		}
	}
 
	function v(i) {
		var s = d(i);
		return s.height > e && s.height < n && s.width > t && s.width < r
	}
 
	function m(e) {
		var t = e;
		var n = 0;
		while (!!t) {
			n += t.offsetTop;
			t = t.offsetParent
		}
		return n
	}
 
	function g() {
		var e = document.documentElement;
		if (!!window.innerWidth) {
			return window.innerHeight
		} else if (e && !isNaN(e.clientHeight)) {
			return e.clientHeight
		}
		return 0
	}
 
	function y() {
		if (window.pageYOffset) {
			return window.pageYOffset
		}
		return Math.max(document.documentElement.scrollTop, document.body.scrollTop)
	}
 
	function E(e) {
		var t = m(e);
		return t >= w && t <= b + w
	}
 
	function S() {
		var e = document.createElement("audio");
		e.setAttribute("class", l);
		e.src = i;
		e.loop = false;
		e.addEventListener("canplay", function() {
			setTimeout(function() {
				x(k)
			}, 500);
			setTimeout(function() {
				N();
				p();
				for (var e = 0; e < O.length; e++) {
					T(O[e])
				}
			}, 15500)
		}, true);
		e.addEventListener("ended", function() {
			N();
			h()
		}, true);
		e.innerHTML = " <p>If you are reading this, it is because your browser does not support the audio element. We recommend that you get a new browser.</p> <p>";
		document.body.appendChild(e);
		e.play()
	}
 
	function x(e) {
		e.className += " " + s + " " + o
	}
 
	function T(e) {
		e.className += " " + s + " " + u[Math.floor(Math.random() * u.length)]
	}
 
	function N() {
		var e = document.getElementsByClassName(s);
		var t = new RegExp("\\b" + s + "\\b");
		for (var n = 0; n < e.length; ) {
			e[n].className = e[n].className.replace(t, "")
		}
	}
 
	var e = 30;
	var t = 30;
	var n = 350;
	var r = 350;
	var i = "//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake.mp3";
	var s = "mw-harlem_shake_me";
	var o = "im_first";
	var u = ["im_drunk", "im_baked", "im_trippin", "im_blown"];
	var a = "mw-strobe_light";
	var f = "//s3.amazonaws.com/moovweb-marketing/playground/harlem-shake-style.css";
	var l = "mw_added_css";
	var b = g();
	var w = y();
	var C = document.getElementsByTagName("*");
	var k = null;
	for (var L = 0; L < C.length; L++) {
		var A = C[L];
		if (v(A)) {
			if (E(A)) {
				k = A;
				break
			}
		}
	}
	if (A === null) {
		console.warn("Could not find a node of the right size. Please try a different page.");
		return
	}
	c();
	S();
	var O = [];
	for (var L = 0; L < C.length; L++) {
		var A = C[L];
		if (v(A)) {
			O.push(A)
		}
	}
})()'>
    <h4>Hi</h4>
</a>

  
  <h5>我是海建东,欢迎访问我的博客.</h5>

</div>


  
  <div class="sidebar-module">
    <h4>分类</h4>
    <ul class="sidebar-module-list"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/ASP-NET/">ASP.NET</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/ASP-NET-Web-API/">ASP.NET Web API</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/Asp-Net-MVC/">Asp.Net MVC</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/Git/">Git</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/Hexo/">Hexo</a><span class="sidebar-module-list-count">10</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/SQL/">SQL</a><span class="sidebar-module-list-count">8</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/UWP/">UWP</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/Umbraco/">Umbraco</a><span class="sidebar-module-list-count">11</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/c/">c#</a><span class="sidebar-module-list-count">18</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/前端开发/">前端开发</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/文集/">文集</a><span class="sidebar-module-list-count">12</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/categories/设计模式/">设计模式</a><span class="sidebar-module-list-count">6</span></li></ul>
  </div>



  
  <div class="sidebar-module">
    <h4>标签</h4>
    <ul class="sidebar-module-list"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/ASP-NET/">ASP.NET</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/ASP-NET-Core/">ASP.NET Core</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/ASP-NET-Web-API笔记/">ASP.NET Web API笔记</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/AngularJS/">AngularJS</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/Asp-Net-MVC/">Asp.Net MVC</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/EntityFramework/">EntityFramework</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/Git学习/">Git学习</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/Hexo博客搭建/">Hexo博客搭建</a><span class="sidebar-module-list-count">10</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/SQL-Server/">SQL Server</a><span class="sidebar-module-list-count">8</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/UWP学习笔记/">UWP学习笔记</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/Umbraco入门/">Umbraco入门</a><span class="sidebar-module-list-count">11</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/WebForm/">WebForm</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/c-基础知识/">c#基础知识</a><span class="sidebar-module-list-count">6</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/c-学习笔记/">c#学习笔记</a><span class="sidebar-module-list-count">12</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/jQuery/">jQuery</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/影评：其实就是观后感/">影评：其实就是观后感</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/设计模式学习笔记/">设计模式学习笔记</a><span class="sidebar-module-list-count">6</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/转载/">转载</a><span class="sidebar-module-list-count">7</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/tags/随笔/">随笔</a><span class="sidebar-module-list-count">8</span></li></ul>
  </div>



  
  <div class="sidebar-module">
    <h4>归档</h4>
    <ul class="sidebar-module-list"><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2016/07/">七月 2016</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2016/05/">五月 2016</a><span class="sidebar-module-list-count">3</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2016/04/">四月 2016</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2016/03/">三月 2016</a><span class="sidebar-module-list-count">14</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2016/02/">二月 2016</a><span class="sidebar-module-list-count">6</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2016/01/">一月 2016</a><span class="sidebar-module-list-count">23</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2015/10/">十月 2015</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2015/09/">九月 2015</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2015/08/">八月 2015</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2015/07/">七月 2015</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2015/06/">六月 2015</a><span class="sidebar-module-list-count">4</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2015/05/">五月 2015</a><span class="sidebar-module-list-count">7</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2015/04/">四月 2015</a><span class="sidebar-module-list-count">6</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2015/03/">三月 2015</a><span class="sidebar-module-list-count">2</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2015/02/">二月 2015</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2015/01/">一月 2015</a><span class="sidebar-module-list-count">1</span></li><li class="sidebar-module-list-item"><a class="sidebar-module-list-link" href="/archives/2014/11/">十一月 2014</a><span class="sidebar-module-list-count">2</span></li></ul>
  </div>



  <!---->
  <div class="sidebar-module">
    <h4>最近访客</h4>
    <!--<ul class="sidebar-module-list">
      
        <li>
          <a href="/2016/07/19/Journey-Under-the-Midnight-Sun/">行走在白昼的夜里</a>
        </li>
      
        <li>
          <a href="/2016/07/18/Hexo-misspelled-tag/">Hexo标签分类写错的处理</a>
        </li>
      
        <li>
          <a href="/2016/07/17/Value-types-and-reference-types/">值类型和引用类型</a>
        </li>
      
        <li>
          <a href="/2016/07/17/Fiddler-caught-analysis-API/">使用Fiddler抓包分析API</a>
        </li>
      
        <li>
          <a href="/2016/05/14/Hexo-Getting-Started-1/">8、使用SSH方式部署博客</a>
        </li>
      
    </ul>
    
    <div class="ds-recent-visitors" data-num-items="12" data-avatar-size="28" id="ds-recent-visitors"></div>
-->
<!-- 多说最新评论 start -->
	<div class="ds-recent-comments" data-num-items="5" data-show-avatars="1" data-show-time="1" data-show-title="1" data-show-admin="0" data-excerpt-length="20"></div>
<!-- 多说最新评论 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"hais2"};
	(function() {
		var ds = document.createElement('script');
		ds.type = 'text/javascript';ds.async = true;
		ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
		ds.charset = 'UTF-8';
		(document.getElementsByTagName('head')[0] 
		 || document.getElementsByTagName('body')[0]).appendChild(ds);
	})();
	</script>
<!-- 多说公共JS代码 end -->
<br><br>
<!---->

  
  <div class="sidebar-module">
    <h4>标签云</h4>
    <p class="tagcloud">
      <a href="/tags/ASP-NET/" style="font-size: 10px;">ASP.NET</a> <a href="/tags/ASP-NET-Core/" style="font-size: 11.11px;">ASP.NET Core</a> <a href="/tags/ASP-NET-Web-API笔记/" style="font-size: 10px;">ASP.NET Web API笔记</a> <a href="/tags/AngularJS/" style="font-size: 11.11px;">AngularJS</a> <a href="/tags/Asp-Net-MVC/" style="font-size: 12.22px;">Asp.Net MVC</a> <a href="/tags/EntityFramework/" style="font-size: 10px;">EntityFramework</a> <a href="/tags/Git学习/" style="font-size: 12.22px;">Git学习</a> <a href="/tags/Hexo博客搭建/" style="font-size: 17.78px;">Hexo博客搭建</a> <a href="/tags/SQL-Server/" style="font-size: 16.67px;">SQL Server</a> <a href="/tags/UWP学习笔记/" style="font-size: 11.11px;">UWP学习笔记</a> <a href="/tags/Umbraco入门/" style="font-size: 18.89px;">Umbraco入门</a> <a href="/tags/WebForm/" style="font-size: 10px;">WebForm</a> <a href="/tags/c-基础知识/" style="font-size: 14.44px;">c#基础知识</a> <a href="/tags/c-学习笔记/" style="font-size: 20px;">c#学习笔记</a> <a href="/tags/jQuery/" style="font-size: 10px;">jQuery</a> <a href="/tags/影评：其实就是观后感/" style="font-size: 13.33px;">影评：其实就是观后感</a> <a href="/tags/设计模式学习笔记/" style="font-size: 14.44px;">设计模式学习笔记</a> <a href="/tags/转载/" style="font-size: 15.56px;">转载</a> <a href="/tags/随笔/" style="font-size: 16.67px;">随笔</a>
    </p>
  </div>


  
  <div class="sidebar-module">
     <iframe width="100%" height="550" class="share_self"  frameborder="0" scrolling="no" src="http://widget.weibo.com/weiboshow/index.php?language=&width=0&height=550&fansRow=2&ptype=1&speed=0&skin=5&isTitle=1&noborder=0&isWeibo=1&isFans=1&uid=3311041262&verifier=85e63399&dpc=1"></iframe>
  </div>


  
  <div class="sidebar-module">
    <h4>友情链接</h4>
    <a href="http://www.cnblogs.com/artech/" target="_blank">Artech</a><br/>
    <a href="http://www.deepthink.pub" target="_blank">DeepThink</a><br/>
    <a href="http://edi.wang/" target="_blank">Edi.wang</a><br/>
    <a href="http://www.lanhusoft.com/Article/List" target="_blank">LanHuSoft</a><br/>
    <a href="http://www.ruanyifeng.com/blog/" target="_blank">阮一峰的网络日志</a><br/>
    <a href="http://www.cnblogs.com/shanyou/" target="_blank">张善友</a><br/>
  </div>




        </div>
    </div>
  </div>
  <footer class="blog-footer">
  <div class="container">
    <div id="footer-info" class="inner">
      &copy; 2016 Is2<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a> and <a href="https://github.com/haijiandong/haijiandong.github.io" target="_blank">GitHub</a><br/>
      Total <span id="busuanzi_value_site_pv"></span> views.  Total <span id="busuanzi_value_site_uv"></span> guests.  Total <span id="busuanzi_value_page_pv"></span> Hits.
    </div>
  </div>
</footer>

  

<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>


<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>


  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css" type="text/css">
  <script src="/fancybox/jquery.fancybox.pack.js" type="text/javascript"></script>


<script src="/js/script.js" type="text/javascript"></script>

</body>
</html>